// 主界面
;
define(function(require, exports, module) {
	'use strict';
	var util = require("util");
	var base = require(CONFIG.BasePath + "js/enterprise/base");
	var router = require("../hash/pageRouter");
	var constant = require("constant");
	var css_pickup = require("./accountPickupDetail.css");
	var databind = require("databind");
	var pickupDelayId;

	var init = function(page) {
		pickupDelayId = page.params.pickupDelayId;
		databind.fillInput($("#accountPickupDelayApplicationDetail"), {
			action:"inquirePickupDelayApplicationDetail.json?pickupDelayId=" + pickupDelayId
		});
		inquirePickupDelayApplicationDetail();
		router.init();
		initEvent();
	};

	var initEvent = function() {
		if (base.getData("sid") == null) {
			location.href = "../login/login.html";
		}
		
		//点击项目基本详情financeDetail
		$(".financeDetail").unbind("click").click(function(){
			router.route("account/accountDetail.html?financeId="+financeId,true);
                	
		});
	};


	//获取提货申请明细
	var inquirePickupDelayApplicationDetail = function() {
		base.fnAjax({
			action: "inquirePickupDelayApplicationDetail.json",
			async: false,
			oData: {
				pickupDelayId: pickupDelayId
			}, //传递参数
			fnSuccess: function(data) {
				if (data.status == 200) {
					var tpl = $("#delayBulkstockDetailInventoryTpl").html();
					var html = juicer(tpl, data);
					$("#delayBulkstockDetailInventoryBody").html(html);
				} else {
					//                  base.alert(2,"信息获取失败");
				}
			}
		});
	};

	return {
		init: init
	};
});